<?php

class m130726_165014_create_goods_table extends Migration
{
	public function up()
	{
        $this->createTable('{{goods}}', array(
            'id' => 'pk',
            'tb_id' => 'int NOT NULL',
            'cat_id' => 'int NOT NULL',
            'title' => 'string NOT NULL',
            'url' => 'string NOT NULL',
            'origin_price' => 'decimal(8, 2) NOT NULL',
            'price' => 'decimal(8, 2) NOT NULL',
            'picture' => 'string NOT NULL',
            'shop_name' => 'string NOT NULL',
            'shop_url' => 'string NOT NULL',
            'status' => 'tinyint NOT NULL DEFAULT 1',
            'list_order' => 'int NOT NULL DEFAULT 0',
            'created_at' => 'int NOT NULL',
            'updated_at' => 'int NOT NULL',
        ));
	}

	public function down()
	{
        $this->dropTable('{{goods}}');
		echo "m130726_165014_create_goods_table does not support migration down.\n";
		return true;
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}
